﻿@model System.Collections.IList
@{
    ViewBag.Title = "BaklogTaskNew";
    Layout = "~/Views/Shared/_BaseLayout.cshtml";
    var X = Html.X();
}
<h2>
    BaklogTaskNew</h2>
@section headtag
{
    <script>
        var linkDetail = function (value) {
            var temp = '<a href="#" onclick="PopHolidayRequest()" style="color:blue">{0}</a>';
            return Ext.String.format(temp, value);
        }

        var PopHolidayRequest = function () {
            document.getElementById("btnPopRequestProcessNew").click();
        }
    </script>
}
@section example
{
    @(X.Viewport()
        .Layout(LayoutType.Border)
           .Items(
               X.Button()
                    .ID("btnPopRequestProcessNew")
                    .Height(20)
                    .DirectEvents(de =>
                    {
                        de.Click.Url = Url.Action("PopRequestProcessNew");
                        de.Click.ExtraParams.Add(new Parameter("processCode", "App.gpBaklogTaskNews.getRowsValues({ selectedOnly: true })[0].TaskType", ParameterMode.Raw));
                    }),
                X.Panel()
                  .Region(Region.Center)
                  .Margins("5 5 5 5")
                  .Items(
                        X.GridPanel()
                            .ID("gpBaklogTaskNews")
                            .Region(Region.Center)
                            .Title("待办列表")
                            .Store(X.Store()
                                    .Model(X.Model()
                                        .Fields(
                                                new ModelField("ProcessID", ModelFieldType.String),
                                                new ModelField("TaskName", ModelFieldType.String),
                                                new ModelField("TaskType", ModelFieldType.String),
                                                new ModelField("RequestPerson", ModelFieldType.String),
                                                new ModelField("CurrentProcessPerson", ModelFieldType.String),
                                                new ModelField("CurrentProcessNodeCode", ModelFieldType.String)
                                                )
                                            )
                                    .DataSource(Model)
                                    )
                            .ColumnModel(
                                         X.Column().Text("TaskName").DataIndex("TaskName").Flex(1).Renderer("linkDetail"),
                                         X.Column().Text("RequestPerson").DataIndex("RequestPerson")
                                         )
                         )
               )
    )
}
